import 'package:flutter/material.dart';
import 'package:sui_shou_pai/chat/message_list.dart';
import 'package:sui_shou_pai/module/top_bar.dart';

import 'employee_list.dart';

class ChatPage extends StatefulWidget {
  ChatPage({Key key}) : super(key: key);

  @override
  _ChatPageState createState() => _ChatPageState();
}

class _ChatPageState extends State<ChatPage> with TickerProviderStateMixin {
  String title = '沟通';
  List<Tab> tabLabels = [Tab(text: '沟通记录'), Tab(text: '员工列表')];

  TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: tabLabels.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: initAppBar(title, tabLabels, _tabController),
      body: TabBarView(
        controller: _tabController,
        children: <Widget>[MessageList(), EmployeeList()],
      ),
    );
  }
}
